package com.atguigu.daijia.driver.service.impl;

import com.atguigu.daijia.common.result.Result;
import com.atguigu.daijia.driver.client.CosFeignClient;
import com.atguigu.daijia.driver.service.CosService;
import com.atguigu.daijia.model.vo.driver.CosUploadVo;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

@Slf4j
@Service("cosService")
@SuppressWarnings({"unchecked", "rawtypes"})
public class CosServiceImpl implements CosService {
    @Resource
    private CosFeignClient cosFeignClient;

    /*
     * @param file
     * @param path 
     * @==============History===============<br/>;
     * @Description //   文件上传
     * @Date 2024/8/1
     * @Author < a href="15991488967@163.com">chen</ a>;
     */
    @Override
    public CosUploadVo uploadFile(MultipartFile file, String path) {
        Result<CosUploadVo> result = cosFeignClient.upload(file,path);
        return result.getData();
    }
}
